<?php
/*
whmtools - easily find accounts on cpanels servers
Copyright (C) 2006  Matthew Davis <matthew@familycampground.org>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


include 'config.php';

$result = mysql_query("SELECT DISTINCT(package) FROM accounts ORDER by package");
print "<table border=1>\n";
print "\t<th>Package Name</th><th>Package Number</th>\n";
while ($packagelist = mysql_fetch_row($result)) {
    $packages = mysql_query("SELECT COUNT(*) FROM `accounts` WHERE `package` LIKE '${packagelist[0]}'");
    print "\t<tr><td>$packagelist[0]</td><td>" . mysql_result($packages,0) . "</td></tr>\n";
}

?>
</table>
